package ninja.awesome.game.gameobject;

import ninja.awesome.framework.Graphics;
import ninja.awesome.framework.Image;
import ninja.awesome.game.Assets;
import ninja.awesome.game.MainGameScreen;
import ninja.awesome.game.NinjaGame;
import ninja.awesome.game.main.Sprites;
import android.graphics.Color;
import android.graphics.Paint;

public class ScoreBoard extends GameObj {

	private int score = 0;
	private int lives;
	private Image image;
	MainGameScreen game;
	Sprites s;
	private MyNinja mp;

	public ScoreBoard(int x, int y, int lives, int score, MainGameScreen game, Sprites s) {
		super(x, y);
		this.lives = lives;
		this.score = score;
		this.game = game;
		this.s = s;
		this.image = s.getBottomSprite();
	}

	public void update() {

	}

	public void draw(Graphics g) {
		// g.drawImage(this.image, xLoc, yLoc);
		if (this.mp != null) {
			g.fillRect(2, 2, NinjaGame.WIDTH / 4 + 25, 120, Color.argb(100, 100, 100, 100));
			Paint p = new Paint();
			p.setTextSize(25);
			p.setColor(Color.YELLOW);
			p.setTypeface(Assets.fontFace);
			g.drawString("Scores: " + mp.getScore(), 10, 30, p);
			p.setColor(Color.BLUE);
			// g.drawString("Lives: " + mp.getLives(), 10, 60, p);
			g.drawString("Remaining Life: " + (mp.getRemainingLives() - 1), 10, 60, p);

			// HEALTH BAR////
			g.fillRect(10, 90, NinjaGame.WIDTH / 4, 15, Color.GRAY);

			if (mp.getHEALTH() >= 0) {
				g.fillRect(10, 90, NinjaGame.WIDTH * mp.getHealthPercent() / 400, 15, Color.GREEN);
			}
		}
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public int getLives() {
		return lives;
	}

	public void setLives(int lives) {
		this.lives = lives;
	}

	public int getX() {
		return xLoc;
	}

	public void setX(int xLoc) {
		this.xLoc = xLoc;
	}

	public int getY() {
		return yLoc;
	}

	public void setY(int yLoc) {
		this.yLoc = yLoc;
	}

	public void setNinja(MyNinja mp) {
		this.mp = mp;
	}

}
